home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / gfx / show / MerlinGfx.lha / escseq.h < prev    next >
C/C++ Source or Header  |  1995-06-07  |  2KB  |  51 lines

  1. /*
  2. **  Filename: escseq.h
  3. **  Date: 93/04/22
  4. **  Contains useful #defines for Console - Windows
  5. **  For ANSI - C  and  C++
  6. **  written by Harald Pehl in 1993
  7. */
  8.  
  9. #ifndef __INCLUDE_ESCSEQ_H
  10. #define __INCLUDE_ESCSEQ_H
  11.  
  12. #ifdef __cplusplus
  13. #include <stream.h>
  14. #define MOVE(x,y)       cout << "\033[" << x << "x" << "\033[" << y << "y";
  15. #define LOCATE(s,z)     cout << "\033[" << s << ";" << z << "H";
  16. #define SET_A_PEN(a)    cout << "\033[3" << a+4 << "m";
  17. #define SET_B_PEN(b)    cout << "\033[4" << b+4 << "m";
  18. #else
  19. #include <stdio.h>
  20. #define MOVE(x,y)       printf ("\033[%dx\033[%dy", x, y);
  21. #define LOCATE(s,z)     printf ("\033[%d;%dH", s, z);
  22. #define SET_A_PEN(a)    printf ("\033[3%dm", a+4);
  23. #define SET_B_PEN(b)    printf ("\033[4%dm", b+4);
  24. #endif
  25.  
  26. #define RESET           "\033[0m"
  27. #define BOLD_ON         "\033[1m"
  28. #define BOLD_OFF        "\033[22m"
  29. #define ITALIC_ON       "\033[3m"
  30. #define ITALIC_OFF      "\033[23m"
  31. #define UNDERLINE_ON    "\033[4m"
  32. #define UNDERLINE_OFF   "\033[24m"
  33. #define INVERS_ON       "\033[7m"
  34. #define INVERS_OFF      "\033[27m"
  35. #define WIDTH(w)        "\033["#w"u"
  36. #define HEIGHT(h)       "\033["#h"t"
  37. #define INSERT_SPACE    "\033[@"
  38. #define CURSOR_UP       "\033[#A"
  39. #define CURSOR_DOWN     "\033[#B"
  40. #define CURSOR_RIGHT    "\033[#C"
  41. #define CURSOR_LEFT     "\033[#D"
  42. #define LINE_UP         "\033[#F"
  43. #define LINE_DOWN       "\033[#E"
  44. #define DEL_EOL         "\033[#K"
  45. #define INSERT_LINE     "\033[#L"
  46. #define DEL_LINE        "\033[#M"
  47. #define SCROLL_UP       "\033[#S"
  48. #define SCROLL_DOWN     "\033[#T"
  49.  
  50. #endif
  51.